import base from './index'
let axios = base.axios
let baseUrl = base.baseUrl

// 获取好友   即有几个会话对象
export const getFriendService = (params) => {
    return axios({
      method: 'get',
      URL: `${baseUrl}/userid=${params.user_id}/list`,//http://127.0.0.1:5000/userid={userid}/list
    }).then(res => res.data)
  }

// 添加好友 聊天   
export const addFriendService =( params )=> {
  let userid = params;
  return axios({
    method: 'post',
    URL: `${baseUrl}/chat/userid=${userid}/create_chats`,
    data: params
  }).then(res => res.data)
}



 //获取历史记录
 export const getHistoryService = (params)=>{
  const Did = params;
  return axios({
    method:'get',
    URL:`${baseUrl}/history/${Did}`,
  }).then(res => res.data)
 }

//删除对象
export const delFriendService = (params)=>{
  return axiox({
    method:'post',
    URL:`${baseUrl}/chat/userid=${params.user_id}/del_chats`,
    params:params
  }).then(res => res.data)
}


